﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace iPick.Business
{
    /// <summary>
    /// Specifies the title and keywords for the page
    /// </summary>
    public class HeaderAttribute : ActionFilterAttribute
    {
        private string _title;

        public HeaderAttribute(string title)
        {
            _title = title;
        }

        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            if (filterContext != null && filterContext.Controller != null)
            {
                filterContext.Controller.ViewData["_Title"] = _title;
            }
        }
    }
}

